package javaNIO1;

import javaNIO1.Selectors.FileLockingThread;

import java.io.IOException;

/**
 * Created with Intel IDEA.
 *
 * @Auther: gjt
 * @Date: 2024/10/22 21:56
 */
public class test {
    public static void main(String[] args) throws IOException {
        String path = "D:\\新建文件夹\\【M01】Lims进样统计表.xlsx";
        // 创建两个线程，尝试获取同一个文件的文件锁
        FileLockingThread thread1 = new FileLockingThread();
        FileLockingThread thread2 = new FileLockingThread();
        FileLockingThread thread3 = new FileLockingThread();
        FileLockingThread thread4 = new FileLockingThread();

        // 设置线程名称
        thread1.setName("Thread 1");
        thread2.setName("Thread 2");
        thread3.setName("Thread 3");
        thread4.setName("Thread 4");

        // 启动线程
        thread1.start();
        thread2.start();
        thread3.start();
        thread4.start();
    }
}
